/**
 *  *2010-7-24 下午01:54:06  add 
 */
package com.base.myproject.client.ui.dialog;

import com.base.myproject.client.system.BaseResource;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Image;

/**
 * MutiMessagesDialog 对话框提示信息的内容
 * @author Administrator 2010-7-24 javazgw@gmail.com
 */
public class MutiMessageItem extends LayoutContainer {
	public static String INFO = "info";
	public static String WARNING = "warning";

	public static String QUESTION = "question";

	public static String ERROR = "error";

	String html = "";
	String type ;
	public MutiMessageItem(String type, String html) {
		this.type = type;
		this.html = html;
		GWT.log("init");
		init();
	}

	private void init() {

	}

	protected void onRender(Element parent, int index) {
		super.onRender(parent, index);
		GWT.log("onRender");
		Image image = new Image();
		if(type.equals(WARNING))
		{
			image.setResource(BaseResource.INSTANCE.Warning32());
			
		}
		else if(type.equals(QUESTION))
		{

			image.setResource(BaseResource.INSTANCE.question32());
		}
		else if(type.equals(ERROR))
		{

			image.setResource(BaseResource.INSTANCE.error32());
		}
		else
		{

			image.setResource(BaseResource.INSTANCE.Info32());
		}
		String str = "<div  style= 'white-space: normal; display: block; width: auto;word-break:break-all;word-wrap:break-word;'> "+html+"	</div> ";
		Html h  = new Html(str);
		add(image);
		add(h);
		
	}

}
